import bus from "@/bus";
let data = {
	status: 'pass',
  columns: [{
      title: '活动名称',
      key: 'name',
      minWidth: 180,
      align: 'left',
      tooltip: true
    }, {
      title: '科室名称',
      key: 'departmentScopeName',
      minWidth: 200,
      tooltip: true
    }, {
      title: '有效时间',
      key: 'startTime',
      minWidth: 320,
      render: (h, params) => {
        return h('div', params.row.startTime + '-' + params.row.endTime)
      }
    }, {
      key: 'goldNum',
      minWidth: 150,
      align: 'right',
      renderHeader: (h) => {
        let oDiv = h('div', [
          h('span', '消耗云豆'),
          h('Icon', {
            props: {
              type: 'ios-help-circle'
            }
          })
        ])
        return h('Tooltip', {
          style: {
            cursor: 'pointer'
          },
          props: {
            transfer: true,
            placement: 'top',
            content: '每次抽奖消耗的云豆',
            maxWidth: '200'
          }
        }, [oDiv])
      }
    }, {
      title: '上下架',
      key: 'isEnable',
      minWidth: 80,
      align: 'left',
      render: (h, params) => {
        return h('i-switch', {
          props: {
            value: params.row.isEnable
          },
          on: {
            'on-change': (v) => {
              bus.$emit('onChange', {row: params.row, v})
            }
          }
        })
      }
    }, {
      title: '操作',
      align: 'right',
      minWidth: 200,
      render: (h, params) => {
        return h('div', [
          h('Button', {
            class: 'mr',
            props:{
              size:'small',
              type:'primary'
            },
            on: {
              click: () => {
                bus.$emit('onEdit', params.row.id, params.row.departmentIdSet)
              }
            }
          },'编辑'),
          h('Button', {
            props:{
              size:'small',
              type: 'warning'
            },
            on: {
              click: () => {
                bus.$emit('onDelete', params.row.id, params.row.name, params.index)
              }
            }
          },'删除')
        ])
      }
  }],
  data: []
}
export default data;